<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2023-04-04
  Time: 11:15
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生列表</title>
    <script>
        function del(){
            return confirm("是否删除？");
        }
    </script>
</head>
<body>
<%@include file="add.jsp"%>
<h1>学生列表</h1>
<table border="1">
    <tr>
        <th>ID</th>
        <th>NAME</th>
        <th>GENDER</th>
        <th>AGE</th>
        <th colspan="2">OPERATIONS</th>
    </tr>
    <c:forEach var="student" items="${sessionScope.students}">
        <tr>
            <td>${student.id}</td>
            <td>${student.name}</td>
            <td>${student.gender}</td>
            <td>${student.age}</td>
            <td><a href="/student/queryById/${student.id}">编辑</a> </td>
            <td><a href="/student/removeById/${student.id}" onclick="del()">删除</a> </td>
        </tr>
    </c:forEach>
</table>
</body>
</html>
